<script>
const Authentication = require('./utils/authentication.js');
const http = require('./utils/http.js');

const storage = require('./utils/storage.js');

const constants = require('./utils/constants.js');

export default {
    data() {
        return {};
    },
    onLaunch: function () {
		//let flag = uni.getStorageSync("flag_new_2");
		// if(!flag){ //新版本清空缓存
		// 	Authentication.clearCache();
		// 	uni.setStorageSync("flag_new_2",true);
		// }
		//uni.removeStorageSync("openAdLogs");
		//storage.put("date_token",'date_token',30);
		//清空缓存
		if(!storage.get(constants.TOKEN_DATE)){
			Authentication.clearCache();
		}
		
		//当前平台
		let provider = "toutiao";
		
		//登录抖音 不做处理
		uni.getProvider({
			service: 'oauth',
			success: function(res) {
				provider = res.provider;
				uni.login({
				  provider: provider,
				  success: function (loginRes) {
					console.log(loginRes)
				  }
				});
			}
		}) 
		
    },
    globalData: {
        appName: ''
    }
};
</script>
<style>
@import './app.css';
</style>
